package dbOperation;

import library.Book;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by v on 17-5-20.
 */
public class DbDelete {
    public static boolean delete(int id){
        Connection connection=DbConnection.getConnection();
        try {
            String sql="DELETE FROM library WHERE id="+id+";";
            Statement st=connection.createStatement();
            return st.executeUpdate(sql)>0;
        }catch (SQLException ex){
            ex.printStackTrace();
        }

        return false;
    }
}
